package cn.wolfcode;

import org.junit.jupiter.api.Test;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

public class testSet {

    @Test
    public void testSetRedis()throws Exception{
        //创建连接池
        JedisPoolConfig config = new JedisPoolConfig();
        JedisPool pool = new JedisPool(config, "127.0.0.1", 6379, 100000);
        //获取连接
        Jedis jedis = pool.getResource();
        //执行命令
        jedis.set("name","xiaogao");

        System.out.println("jedis.get(\"name\") = " + jedis.get("name"));
        //释放资源
        jedis.close();

    }
}
